import axiosHttp from "../index";
import type { TeamModel } from "./model";
import type { ApiResponse, PageParams } from "../type";
import type { CreateTeamParams } from "./type";

export const getTeamList = () => {
  return axiosHttp.get<ApiResponse<TeamModel[]>>("/api/team/list");
};

export const createTeam = (data: CreateTeamParams) => {
  return axiosHttp.post<ApiResponse<TeamModel>>("/api/team/edit", data);
};

export const getTeamUserList = (id: number) => {
  return axiosHttp.get<ApiResponse<TeamModel>>(`/api/team/${id}`);
};

export const deleteTeam = (id: number) => {
  return axiosHttp.delete(`/api/team/delete/${id}`);
};
